package com.docmgmt.mvp.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 文件夹权限表
 * </p>
 *
 * @author Dora
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("perm_folder_permission")
public class FolderPermissionEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 权限ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 文件夹ID
     */
    @TableField("folder_id")
    private Long folderId;

    /**
     * 授权对象类型：user/group/dept/all
     */
    @TableField("subject_type")
    private String subjectType;

    /**
     * 授权对象ID（all时为NULL）
     */
    @TableField("subject_id")
    private Long subjectId;

    /**
     * 权限级别（v3.0新增）：owner/admin/write/read
     */
    @TableField("permission_level")
    private String permissionLevel;

    /**
     * 可读（v3.0新增）：1是 0否
     */
    @TableField("can_read")
    private Byte canRead;

    /**
     * 可写（v3.0新增）：1是 0否
     */
    @TableField("can_write")
    private Byte canWrite;

    /**
     * 可删除（v3.0新增）：1是 0否
     */
    @TableField("can_delete")
    private Byte canDelete;

    /**
     * 可分享（v3.0新增）：1是 0否
     */
    @TableField("can_share")
    private Byte canShare;

    /**
     * 可管理权限（v3.0新增）：1是 0否
     */
    @TableField("can_manage_permission")
    private Byte canManagePermission;

    /**
     * 是否继承自父文件夹：1是 0否
     */
    @TableField("is_inherited")
    private Byte isInherited;

    /**
     * 优先级（v3.0新增）：数字越大优先级越高
     */
    @TableField("priority")
    private Integer priority;

    /**
     * 创建人ID
     */
    @TableField("created_by")
    private Long createdBy;

    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
}
